home *** CD-ROM | disk | FTP | other *** search
/ Programming Microsoft Visual Basic .NET / Programming Microsoft Visual Basic .NET (Microsoft Press)(X08-78517)(2002).bin / setup / vbnet / 23 web forms and controls / databinding / singlevaluedatabindingform.aspx < prev    next >
Encoding:
ASP.NET Web Form  |  2002-03-17  |  1.5 KB  |  36 lines

  1. <%@ Page Language="vb" AutoEventWireup="false" Codebehind="SingleValueDataBindingForm.aspx.vb" Inherits="DataBinding.SingleValueDataBindingForm" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3. <HTML>
  4.     <HEAD>
  5.         <title>SingleValueDataBindingForm</title>
  6.         <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
  7.         <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
  8.         <meta name="vs_defaultClientScript" content="JavaScript">
  9.         <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  10.     </HEAD>
  11.     <body>
  12.         <FORM id="Form1" method="post" runat="server">
  13.             <H1>Simple Data Binding Demo</H1>
  14.             <P>This page demonstrates how you can do simple data binding on a form. Select a 
  15.                 record from the DropDownList control and view the fields of the corresponding 
  16.                 record.</P>
  17.             <P> </P>
  18.             <P><STRONG>Select a Title: 
  19.                     <asp:dropdownlist id="ddlTitles" runat="server" Width="356px" AutoPostBack="True"></asp:dropdownlist></P>
  20.             <HR width="100%" noShade SIZE="2">
  21.             <P>Title:
  22.                 <asp:textbox id="txtTitle" runat="server" Width="243px" Text='<%# Titles("title") %>'>
  23.                 </asp:textbox></P>
  24.             <P>Price:
  25.                 <asp:textbox id="txtPrice" runat="server" Width="93px" Text='<%# DataBinder.Eval(Titles, "(""price"")", "{0:C4}") %>'>
  26.                 </asp:textbox></P>
  27.             <P>Type:
  28.                 <asp:textbox id="txtType" runat="server" Text='<%# Titles("type") %>' >
  29.                 </asp:textbox></P>
  30.             <P></STRONG> </P>
  31.             <P>
  32.         </FORM>
  33.         </P>
  34.     </body>
  35. </HTML>
  36.